Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix (target start): curveadm target start timeout #364

Merged
merged 1 commit into from
Nov 24, 2023

Conversation

zztaki
Copy link

@zztaki zztaki commented Nov 23, 2023

Related to this issue.

In curve tgt deployment, we start the tgtd daemon on the specified host using curveadm target start --host target-host -c client.yaml. This command will timeout but in fact, the tgtd has been started.

image

Looking through these codes, I found this command is mainly executed by sudo docker exec <ContianerId> tgtd -f & on the remote host and we need to wait its returns (combined stdout and stderr) to end with no error. But since sudo docker exec <ContianerId> tgtd -f & executes in non-detached mode, it will occupy its stdout, which causes the callback function can't return and then timeout.

So, I try to add -d parameter to ContainerExec, which makes tgtd running in detached mode correctly.

@caoxianfei1
Copy link
Contributor

@zztaki We recommend modifying the commit message Fix(target start): ... and It will greatly improve convenience and readability.

@@ -127,7 +127,7 @@ func NewStartTargetDaemonTask(curveadm *cli.CurveAdm, cc *configure.ClientConfig
ExecOptions: curveadm.ExecOptions(),
})
t.AddStep(&step.ContainerExec{
Command: "tgtd -f &",
Command: "-d tgtd -f &",
Copy link
Contributor

@caoxianfei1 caoxianfei1 Nov 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe modify the step of ContainerExec it better?

ContainerExec{
    Command: "tgtd -f",
    Detached: true,
    ...
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, it's attractive! I didn't notice there was this option

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But you need to add it, now it doesn't support --detach option

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no problem!

@zztaki zztaki changed the title [FIX]: curveadm target start timeout Fix (target start): curveadm target start timeout Nov 24, 2023
@caoxianfei1
Copy link
Contributor

LGTM!

Copy link
Collaborator

@Wine93 Wine93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@caoxianfei1 caoxianfei1 merged commit 9d83a9c into opencurve:develop Nov 24, 2023
3 checks passed
@zztaki zztaki deleted the fix-target-start-timeout branch December 22, 2023 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants